// Created by Bassoe

var status = 0;

function start() {
    status = -1;
    action(1, 0, 0);
}

function action(mode, type, selection) {
	if (mode == -1) {
        	cm.dispose();
	} else {
        	if (mode == 1) {
        		status++;
	        } else {
            		status--;
        	}
        	if (status == 0) {
			cm.advance1();
		} else if (status == 1) {
			cm.advance2(selection);
		} else {
			cm.advance3(selection);
		} 
	}
}	